<?php
namespace app\admin\controller;
use app\admin\controller\BaseController;
use app\common\errcode\AdminErrCode;
use app\common\errcode\AdminErrMsg;
use think\Loader;

class BrandController extends BaseController
{
    protected $brandModel;

    public function __construct()
    {
        parent::__construct();
        $this->brandModel = new \app\admin\model\BrandModel();
    }

    /**
     * 品牌列表    
     * @param   string  $brand      品牌名
     * @param   int     $pagesize   页码大小
     * @param   int     $page       页码
     * @return  string
     */
    public function index()
    {
        try {
            if($this->request->isPost()){
                $data = $this->request->post();
                return $this->jsonJump(AdminErrCode::SUCCESS,AdminErrMsg::SUCCESS,$this->brandModel->getList($data));
            }    
        } catch (\Exception $e) {
            \app\common\model\CommonModel::savelog($this->uid,$e,$this->request->path());
            return $this->jsonJump(AdminErrCode::SYSTEM_ERROR,AdminErrMsg::SYSTEM_ERROR . ',错误信息:'. $e->getMessage());
        }
    }
}